<template>
  <div class="company-list">
      <el-card class="box-card" style="position: relative">
          <div class="companyBox">
              <el-tree
                  :data="options"
                  :highlight-current="true"
                  :default-expand-all="true"
                  :expand-on-click-node="false"
                  :default-checked-keys="[1]"
                  node-key="uuid"
                  :indent="0"
                  ref="tree"
              >
                  <span class="custom-tree-node" slot-scope="{ data }">
                      <span>
                          <i class="iconfont icon-gongsi-"></i>
                          <span>{{ data.name }}</span>
                      </span>
                  </span>
              </el-tree>
          </div>
      </el-card>

  </div>
</template>

<script>
import {queryCourseThree} from '@/api/train/dashboard.js'
export default {
      props:{
          safetyTrainingContentId: Number
      },
      data() {
          return {
              name: "",
              sectionName: "",
              defaultProps: {
                  children: "children",
                  label: "name",
              },
              options: [],
          };
      },
      watch: {
          filterText(val) {
              this.$refs.tree.filter(val);
          },
      },
      created() {
          this.getCourseThree();
      },
      mounted() {
      },
      methods: {
          // 获取课件列表
           getCourseThree() {
              queryCourseThree({
                  id: sessionStorage.getItem("safetyTrainingContentId")
              }).then(res=>{
                  console.log(res)
                  if (res.code == 2000) {
                  this.options = res.data;
              }
              })
              
          },
        
      },
  };
</script>

<style >
  
</style>
